<template>
    <div class="app-container">
        <levelbar></levelbar>
        <div class="withdrawals">
            <el-row :gutter="41">
                <el-col :span="12">昨日结算（元）：<span style="margin-left:5px;">{{yesterday.convertMoney}}</span></el-col>
                <el-col :span="12">累计结算金额（元）：<span style="margin-left:5px;">{{addUp.convertMoney}}</span></el-col>
            </el-row>
        </div>
        <el-tabs v-model="activeName">
            <el-tab-pane label="经销商结算" name="first">
                <student-manage></student-manage>
            </el-tab-pane>
            <el-tab-pane label="一卡通结算" name="second">
                <teacher-manage></teacher-manage>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
import {getYesterdaySettlement, getAccumulatedSum} from 'api/settleManagement';
import Levelbar from '../layout/Levelbar';
import studentManage from './comps/studentManage';
import teacherManage from './comps/teacherManage';
export default {
    components: { Levelbar, studentManage, teacherManage},
    data() {
        return {
            activeName: 'first',
            yesterday: '',
            addUp: ''
        }
    },
    created() {        
        this.searchData();
    },
    methods: {  
        searchData() { 
            getYesterdaySettlement().then(response => {
                this.yesterday = response.data.content;
                this.yesterday.convertMoney = parseFloat(this.yesterday.money).toFixed(2);
            
            });
            getAccumulatedSum().then(response => {
                this.addUp = response.data.content;
                this.addUp.convertMoney = parseFloat(this.addUp.money).toFixed(2);
            });
        }

    }
}
</script>
<style lang="scss" scoped>
.withdrawals{
        width:100%;
        background:#fff;
        padding:30px 100px;
        margin-bottom:20px;
        box-shadow: 0px 1px 2px #999;
        -webkit-box-shadow: 0px 1px 2px #999;
        .el-col{
            text-align:left;
            span{
                margin-left:10px;
                font-size:18px;
                display:inline-block;
            }
        }
    }
</style>